#include"processBar.h"

typedef void(*callback)(int); 

void download(callback cb)
{
    int total = 1000;
    int cur = 0;
    while(total >= cur)
    {
        usleep(50000);
        int rate = cur*100/total;

        cb(rate);
     
        cur += 10;
    }
    printf("\n");
}

int main()
{
    download(processbar);
    init();

    download(processbar);
    init();

    download(processbar);
    init();
   
    download(processbar);
    init();
   
    return 0;
}
